package com.qingcloud.fexecutor.base.pojo;

import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Collections;
import java.util.List;

/**
 * 分页结果包装对象
 *
 * @author 王金楠
 */
@Getter
@Setter
@AllArgsConstructor
@Accessors(chain = true)
public class TablePageDTO<T extends Serializable> implements Serializable {

    public TablePageDTO() {
        this.total = 0;
        this.list = Collections.emptyList();
    }

    @ApiModelProperty(value = "数据总条数", example = "1")
    private Integer total;

    @ApiModelProperty(value = "数据列表")
    private List<T> list;

    @Override
    public String toString() {
        return "TablePageDTO{" +
                "total=" + total +
                '}';
    }
}